var swfu;

function swfupload_init(upload_url, sub_folder) {
	var settings = {
		flash_url : "/Public/js/swfupload/swfupload.swf",
		upload_url : upload_url,
		post_params : {
			"sub_folder" : sub_folder,
		},
		file_size_limit : "10 MB",
		file_types : "*.*",
		file_types_description : "All Files",
		file_upload_limit : 100,
		file_queue_limit : 0,
		custom_settings : {
			progressTarget : "fsUploadProgress"
		},
		debug : false,

		// Button settings
		button_image_url : "/Public/img/buttom_file.png",
		button_width : "85",
		button_height : "24",
		button_placeholder_id : "spanButtonPlaceHolder",
		button_text : '<span class="theFont">添加附件</span>',
		button_text_style : ".theFont { font-size: 12; }",
		button_text_left_padding : 23,
		button_text_top_padding : 1,
		button_window_mode : "Opaque",
		button_cursor : SWFUpload.CURSOR.HAND,

		// The event handler functions are defined in handlers.js
		file_queued_handler : fileQueued,
		file_queue_error_handler : fileQueueError,
		file_dialog_complete_handler : fileDialogComplete,
		upload_start_handler : uploadStart,
		upload_progress_handler : uploadProgress,
		upload_error_handler : uploadError,
		upload_success_handler : uploadSuccess,
		upload_complete_handler : uploadComplete
	};
	swfu = new SWFUpload(settings);
}

